import { request } from "@/utils/request";

// 查询库房列表
export function getAutomationRoom(params) {
  return request({
    url: "/robot/getAutomationRoom",
    method: "GET",
    params,
  });
}

// 查询设备进出口信息列表
export function robotInAndOut(params) {
  return request({
    url: "/robot/robotInAndOut",
    method: "GET",
    params,
  });
}

// 导出设备进出口信息列表
export function normalResourceReport(params) {
  return request({
    url: "/robot/normalResourceReport",
    method: "GET",
    params,
  });
}

// 查询库房日报列表
export function storeroomList(params) {
  return request({
    url: "/robot/storeroomList",
    method: "GET",
    params,
  });
}

// 获取机器人配置列表
export function getRobotList(params) {
  return request({
    url: "/robot/getRobotList",
    method: "GET",
    params,
  });
}

// 新增机器人配置
export function addRobotSetting(data) {
  return request({
    url: "/robot/robotSetting",
    method: "POST",
    data,
    type: 2,
  });
}

// 获取机器人配置
export function detailRobotSetting(robotNumber) {
  return request({
    url: "/robot/robotDetail/" + robotNumber,
    method: "GET",
  });
}

// 修改机器人配置
export function updateRobotSetting(data) {
  return request({
    url: "/robot/robotUpdate",
    method: "POST",
    data,
    type: 2,
  });
}

// 删除机器人配置
export function deleteRobotSetting(id) {
  return request({
    url: "/robot/robotDelete/" + id,
    method: "GET",
  });
}

// 机器人绑定机房
export function binging(data) {
  return request({
    url: "/robot/binging",
    method: "POST",
    data,
    type: 2,
  });
}

// 机器人解绑机房
export function cancelBinging(data) {
  return request({
    url: "/robot/cancelBinging",
    method: "POST",
    data,
    type: 2,
  });
}

// 查询轨道机器人机房机柜列表详情
export function normalResource(params) {
  return request({
    url: "/robot/normalResource",
    method: "GET",
    params,
  });
}

// 查询巡检任务列表
export function robotTaskList(params) {
  return request({
    url: "/robot/robotTaskList",
    method: "GET",
    params,
  });
}

// 新增巡检任务
export function robotTaskSetting(data) {
  return request({
    url: "/robot/robotTaskSetting",
    method: "POST",
    data,
    type: 2,
  });
}

// 编辑巡检任务
export function robotTaskUpdate(data) {
  return request({
    url: "/robot/robotTaskUpdate",
    method: "POST",
    data,
    type: 2,
  });
}

// 删除巡检任务
export function robotTaskDelete(taskId) {
  return request({
    url: "/robot/robotTaskDelete/" + taskId,
    method: "GET",
  });
}

// 查询巡检任务状态
export function robotStatus(robotNumber) {
  return request({
    url: "/robot/robotStatus/" + robotNumber,
    method: "GET",
  });
}

// 获取机器人下的预置位列表
export function presetList(params) {
  return request({
    url: "/robot/presetList",
    method: "GET",
    params,
  });
}

// 新增预置位
export function robotPresetSetting(data) {
  return request({
    url: "/robot/robotPresetSetting",
    method: "POST",
    data,
    type: 2,
  });
}

// 修改预置位
export function robotPresetUpdate(data) {
  return request({
    url: "/robot/robotPresetUpdate",
    method: "POST",
    data,
    type: 2,
  });
}
// 删除预置位
export function robotPresetDelete(id) {
  return request({
    url: "/robot/robotPresetDelete/" + id,
    method: "GET",
  });
}

// 控制机器人
export function robotOperate(data) {
  return request({
    url: "/robot/operate",
    method: "POST",
    data,
    type: 2,
  });
}

// 控制机器人到资产机柜附近
export function robotToAsset(data) {
  return request({
    url: "/robot/toAsset",
    method: "POST",
    data,
    type: 2,
  });
}

// 根据巡检任务获取预置点列表
export function robotPresetList(params) {
  return request({
    url: "/robot/robotPresetList",
    method: "GET",
    params,
  });
}

// 巡检任务绑定预置点
export function taskBingPreset(data) {
  return request({
    url: "/robot/taskBingPreset",
    method: "POST",
    data,
    type: 2,
  });
}

// 定位到预置点
export function orientation(data) {
  return request({
    url: "/robot/orientation",
    method: "POST",
    data,
    type: 2,
  });
}

// 立即执行巡检任务
export function run(data) {
  return request({
    url: "/robot/run",
    method: "POST",
    data,
    type: 2,
  });
}

// 终止巡检任务
export function stop(data) {
  return request({
    url: "/robot/stop",
    method: "POST",
    data,
    type: 2,
  });
}